Skip to content

Add network modification row expansion#3824

Draft
Meklo wants to merge 39 commits intomainfrom
marcellinh/add_network_modification_row_expansion
Draft

Add network modification row expansion#3824
Meklo wants to merge 39 commits intomainfrom
marcellinh/add_network_modification_row_expansion

Conversation

@Meklo
Copy link
Contributor

@Meklo Meklo commented Mar 20, 2026

PR Summary

Implements ability to insert and browse through composite modifications
What's included in this PR :

  • New modal to either insert or split one/multiple composite modifications from gridexplore
  • Ability to expand composite modifications
  • Custom style to maximize information density when browsing composite modifications :
    • A composite header and its submodifications are at the same level visually
    • Depth is visually added only when encountering a new composite
    • The name cell handles the display of the depth indicator (DepthBox component), expansion toggler and surounding of the modification name with borders
    • When a composite is expanded the borders around all the drag handles and select cells of its submodifications are dissolved to clearly indicate when a composite starts and ends
    • The DepthBox displays a faint tick to its right when encountering a nested composite to clarify the data flow
  • Modifying a submodification like any other modification at root level
  • Ability to drag and drop composite submodifications :
    • Inbetween composite modifications
    • From inside composite to root level
    • From root level into a composite
  • Visual indicator to display when a dnd operation is forbidden :
    • When dragging a composite header inside itself
    • When dragging a composite into another composite (the technical base is here but it's temporally locked until proper backend limits are set)
  • When selecting only part of a composite submodification it will display an indeterminate indicator on the composite select box
  • Automatic sub-selection of a composite's children has been disabled (enableSubRowSelection: false) to avoid conflicts with shift-click selection behaviour
  • DragCloneRow has been reworked to be visually static to avoid glitches related to the extra rendering layer introduced by the name cell
  • Enable/disable toggle (SwitchCell) and root-network chip activation (RootNetworkChipCell) now work correctly for sub-modifications at any depth, using tree-aware state updates
  • Optimistic UI updates for all DnD operations (sub-row moves update composedModifications immediately and roll back on API error)

Technical notes :

Sub-modifications are lazily loaded: at initialisation only root-level modifications are retrieved. The backend metadata model does not include sub-modification content, so data reconciliation is performed client-side. When a composite is expanded, an API call retrieves its children and inserts them into the dataset. The new getNetworkModificationsFromComposite API accepts multiple UUIDs in a single call and returns a Record<UUID, NetworkModificationMetadata[]>, replacing the previous per-UUID request pattern.

This adds complexity around stale data management when the root dataset is updated via WebSocket notifications, but keeps the backend model simple and ensures faster initialisation. A suite of recursive tree utility functions (findModificationsInTree, updateModificationInTree, mergeSubModificationsIntoTree, moveSubModificationInTree, updateModificationFieldInTree) has been added to handle all tree traversal, optimistic update, and merge operations. When refetching sub-modifications after a data refresh, previously loaded nested children are preserved by merging the fresh API response with the existing tree state.

The DnD logic has been split into two distinct paths since root-level moves and composite sub-modification moves have different backend models: root moves operate on group UUIDs, while composite moves reference parent composite UUIDs via a dedicated endpoint (PUT .../composite-sub-modification/{modificationUuid}).

What's left to do :

  • Handle composite submodifications restoration in the modification bin
  • Handle composite submodifications cut ability (copy/paste works out of the box)
  • Implement backend depth limit for composite modifications to unlock DnD of composite headers into other composites
  • Ability to rename composite on the fly

Additional note :

Sonar reliability rating is a false positive triggered by yup schema structure

@coderabbitai

This comment was marked as outdated.

coderabbitai[bot]

This comment was marked as outdated.

@Meklo Meklo marked this pull request as draft March 20, 2026 13:45
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant